-
Notifications
You must be signed in to change notification settings - Fork 0
add isValueExpectedForType to handle abstract types #29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
f61f2b1 to
d5ba41c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a bunch of new tests with valid outputs, but should we have more with errors to know that we're properly validating and not accidentally skipping validating objects?
|
(oops, accidentally hit approve when I meant to comment) |
6e2bb1c to
84542dd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was able to run through the code and have it make sense with one of the example query and fixture that utilized union 👍🏻
The fixture input validator doesn't currently handle GraphQL abstract types where different items can be different concrete types.
In this PR, when a field is missing from a fixture, we use
typeInfo.getParentType()to determine the concrete type, and validate whether that field is actually expected based on the fixture value's__typename.